package main

import (
	"fmt"
)

/*
go中任意类型是 interface{}，类似于java中的Object类型

当key为string，value为任何类型的时候
map[string]interface{}
*/
func main() {
	//anyMap := make(map[string]interface{})
	anyMap := make(map[string]interface{}, 8) //后面的整数是cap，规定map的初始大小
	anyMap["key1"] = 5
	anyMap["key2"] = "sdclone"
	anyMap["key3"] = Student{"xyt", 3}

	for k, v := range anyMap {
		fmt.Println("key = ", k)
		fmt.Println("value = ", v)
	}
	/*
		key =  key3
		value =  {xyt 3}
		key =  key1
		value =  5
		key =  key2
		value =  sdclone
	*/
}

type Student struct {
	Name string
	Age  int
}
